scrolledwindow test: Check natural width for max content size
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>
Tue, 7 Jun 2016 05:02:37 +0000 (14:02 +0900)
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>
Thu, 9 Jun 2016 05:57:10 +0000 (14:57 +0900)
The maximum content size does not increase the minimum request
but only ensures that both minimum and natural requests do not
exceed the maximum setting.

testsuite/gtk/scrolledwindow.c

index 2a72daaf1f52faf7c9e7694b6496853ce4e78d72..317f91313511e560ac2da5ad26cc8d6ac8e8c71b 100644 (file)
@@ -46,11 +46,11 @@ test_size (GtkOrientation orientation,
            * Here, the content is purposely bigger than the scrolled window,
            * so it should grow up to max-content-width.
            */
-          gtk_widget_get_preferred_width (scrolledwindow, &size, NULL);
+          gtk_widget_get_preferred_width (scrolledwindow, NULL, &size);
           gtk_widget_get_preferred_width (box, &child_size, NULL);
 
           g_assert_cmpint (child_size, ==, BOX_SIZE);
-          g_assert_cmpint (size, >=, MAX_SIZE);
+          g_assert_cmpint (size, ==, MAX_SIZE);
         }
     }
   /* Testing the content-height property */
@@ -74,11 +74,11 @@ test_size (GtkOrientation orientation,
            * Here, the content is purposely bigger than the scrolled window,
            * so it should grow up to max-content-height.
            */
-          gtk_widget_get_preferred_height (scrolledwindow, &size, NULL);
+          gtk_widget_get_preferred_height (scrolledwindow, NULL, &size);
           gtk_widget_get_preferred_height (box, &child_size, NULL);
 
           g_assert_cmpint (child_size, ==, BOX_SIZE);
-          g_assert_cmpint (size, >=, MAX_SIZE);
+          g_assert_cmpint (size, ==, MAX_SIZE);
         }
     }
 }